﻿using Magicodes.ExporterAndImporter.Excel.AspNetCore;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using NP.BPMReportPlatform.AUTO.Adjust.Dto;
using NP.BPMReportPlatform.AUTO.Quotation.Dto;
using NP.BPMReportPlatform.AUTO.TechnicalDependence.Dto;
using NP.BPMReportPlatform.IUTS.Dto;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
namespace NP.BPMReportPlatform.IUTS
{
    /// <summary>
    ///IU投诉
    /// </summary>
    //[Authorize]
    [ApiController]
    [Route("api/iumachinecomplaints")]
   public  class ProductComplaintsController : BPMReportPlatformController
    {
        private readonly IProductComplaintsAppService _iczhylsService;

        public ProductComplaintsController(IProductComplaintsAppService iczhylsService)
        {
            _iczhylsService = iczhylsService;
        }

        /// <summary>
        ///IU投诉审批流程 查询数据
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("IUTS/GetAllAsync")]
        public async Task<PagedResultDto<IUTSOutput>> GetAllAsync([FromBody] GetIUTSInput input)
        {
            return await _iczhylsService.GetAllAsync(input);
        }

        /// <summary>
        ///IU投诉审批流程 导出数据
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("IUTS/Export1Async")]
        public async Task<XlsxFileResult<ExportIUTSOutput>> Export1Async([FromBody] GetIUTSInput input)
        {
            var rst = await _iczhylsService.Export1Async(input);
            return new XlsxFileResult<ExportIUTSOutput>(rst, "导出Excel");
        }
         
         
    }
}
